import { api } from "@/api/api";

export const getModelCategory = async () => {
  try {
    const response = await api.get('/java/ground/model/get_common_model_tags');
    return response.data
  }
  catch (error) {
    console.error('获取资源信息失败', error)
    throw error
  }
}

export const getModelMetadata = async (payload: any) => {
  try {
    const response = await api.post('/java/ground/model/get_model_metadata', payload);
    return response.data;
  }
  catch (error) {
    console.error('获取模型元数据失败', error);
    throw error;
  }
};
export const getModelInfo = async (targetId: string) => {
  try {
    const response: any = await api.post('/java/ground/model/get_model_information', {
      targetId,
    });
    return response.data
  }
  catch (error) {
    console.error('获取模型详情失败', error);
    throw error;
  }
};
